﻿<div class="wide form">
<?php 
	/*$form=$this->beginWidget('CActiveForm', array(
	'id' => 'form',
	//'action'=>Yii::app()->createUrl($this->route),
	//'enableAjaxValidation'=>true,
	'method'=>'get',
	'stateful'=>true) ,
	array('enctype'=>'multipart/form-data'),
);*/
 ?>
<?php
$form = $this->beginWidget('CActiveForm', array(
  'id'=>'formSearchByUser', 
  'action'=>Yii::app()->createUrl($this->route),
  'enableAjaxValidation'=>true, 
  'stateful'=>true,
  'htmlOptions'=>array('enctype' => 'multipart/form-data'),
  'method' => 'get' ,
));
	$data = User::model()->findAll();
	$list = CHtml::listData($data, 'id' , 'full_name' ,'username' );
	//die(print_r($list));
?>
	<div id="condition">
		<div class="row">
			<?php //echo $form->label($model,'userName'); ?>
			<label>Nhân sự</label>
			<?php echo $form->dropDownList(
							$model,
							'user_id',
							CHtml::listData(User::model()->findAllbySql('SELECT id, CONCAT(username, "-", full_name) as full_name FROM hd_user WHERE user_type_id = 1'
							), 'id', 'full_name')
					);
			?>		
		</div>
	</div>
	<div id="statisticsByUser">
		<div class="buttons user">
			<?php echo CHtml::submitButton('Xem trực tiếp' , array('submit'=>array('job/statisticsUserSubmit'))); ?>
			<?php echo CHtml::submitButton('Xuất excel' , array('submit'=>array('job/statisticsUserExcel') , 'params'=>array('redirect'=>true))); ?>		
		</div>
	</div>
	<div style="clear: both;"></div>
<?php $this->endWidget(); ?>
</div><!-- search-form -->